

<template>
  <div class="hello">
    <Button class="btn btn-info" v-on:click="demo">{{ i }}</Button>
    <h2>{{a}}</h2>
    <h1>{{ msg }}</h1> 
    <Button>hello</Button>
  </div>
</template>

<script>
import { Button } from 'vant';

export default {
  name: 'HelloWorld',
  props: {
    msg: String
  }, 
  components:{
    Button
  },
  data(){
    return {
      i:0
    }
  },
  created(){
    console.log('创建成功')
  },
  computed:{
      a:function(){
        return this.i*10;
      }
  },
  methods:{
    demo:function(){
      this.i+=1;
      console.log('this.i', this.i)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
